C Language resolution WAV audio file code address: Github:github.com/casterwx/c-wave-master Directory
Objective
Understanding WAV Audio Files
What is a binary file
Binary format parsing of WAV
C language parsing
WAV audio files
Chess Boy 1048272975
WAV is a file format for saving audio information that is widely used in Windows and its applications, and today the mainstream audio player supports the playback of
Whether it is text, image or sound, must be organized and stored in a certain format, so that the player will know how to parse this piece of data, for example, for the original image data, our common format is YUV, Bitmap, and for audio, the simplest common format is the WAV format.WAV format, like bitmap, are Microsoft developed a file format specification, they all have a similarity, is the whole file is
Applies to all PowerShell versions
In fact, playing WAV files in PowerShell is very simple:
Copy Code code as follows:
# Find an available WAV audio file in the Windows directory
$WAVPath = Get-childitem-path $env: windir-filter *.wav-recurse-erroraction si
Question: How to play WAV audio files in the wince System
Mailing site: dianheting BBS (Tue Apr 15 12:55:40 2008), this site (bbs.cumt.edu.cn)
This example runs successfully in the wince5.0 +. Net cf2.0 environment.
The following namespace must be referenced in this example:
System
System. Io
System. Reflection
System. runtime. interopservices
System.
This article recommends a good example program for playing Wav audio files. If you want to use java, you can refer to it.
The Code is as follows:
Copy code
Import java. io. File;Import java. io. FileInputStream;Import javax. sound. sampled .*;Import javax. swing .*;Public class test extends JFrame{Public static void main (String [] args){T
First, your resources should be in WAV format and include header files and required library files as follows#include #pragma comment (lib, "Winmm.lib")
The declaration of the PlaySound function is:
BOOL PlaySound (lpcstr pszsound, hmodule hmod,dword fdwsound);
PlaySound (null,null,null); stop playing.
The parameter pszsound is a string that specifies the soun
The first three articles have explained in detail how to convert the WAV audio format to the FLV format. This article describes how to convert the last part, first, the AMR is converted into WAV format, and then the WAV format is encapsulated
FLV format. The key part of this article is the part in the while loop. The o
Problem
You want to have a method for playing sound quickly. Solution
In xna3.0, you can directly load and play sounds from xNa without loading them using xact. Although this method removes some advanced xact functions, it makes playing sound very easy. Working Principle
First, add a sound file to the project. The method is the same as adding an image to the project. For more information, see tutorial 3-1. The simplest solution is to drag a .wav fi
Based on the analysis of the FLV format in the previous article, the FLV format includes file header and file body. Therefore, you can define file header and previous tag size #0 as follows:
Const static unsigned char flvfilehdr [] = {0x46, 0x4c, 0x56, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00};
The file body consists of the tag header and tag data. Therefore, the tag header can be defined as follows:
Unsigned char flvtaghdr [] = {0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0 x, 0x00};
Note:
1. WAV Overview wav is A sound file format developed by Microsoft Corporation (Microsoft) that complies with the riff (Resource Interchange File format) files specification, The audio information resource for saving the Windows platform is widely supported by the Windows platform and its applications, which also suppo
[] pbaacbuffer;}Int wavtoaac (const char * wavdata, int wavdatalen, char * aacdata ){/*** Convert WAV audio data of the length of wavdatalen into AAC and write aacdata* If AAC data is successfully returned, the value-1 is returned if an error occurs.*/If (hencoder = NULL ){Return-1;}Int32 ninputsamples = 0;Int32 readpcmbytesum = 0;Int32 writeaacbytesum = 0;Int32 naacencret = 0;Int32 J = 0;Int32 K = 0;While
binary. PCM indicates the amplitude of a piece of audio in an audio file over time. Android supports PCM audio data in WAV Files.WAV FilesWAV and MP3 are common audio formats. Different encoding formats use different encoding methods for the original
Find the uda1341 driver on the internet, compile it into the uda1341.ko module, and open the Kernel configuration menu.Device Drivers --->Sound --->Make modules generates the soundcore. Ko module. Load the two modules to play the audio.
After carefully reading the uda1341 driver, we found that only 16 bits of audio can be played.Convert to dual-channel when copying to the driver. Therefore, we recommend tha
File format (Resourcesinterchange fileformat), RIFF files are a file structure that most multimedia files in the Windows environment follow. The data type that the riff file contains is identified by the file's extension, and the data that can be stored in the riff file includes: Audio Video Interleaved format data (. AVI) waveform format data (.
binary binary. PCM represents the amplitude of a piece of audio in an audio file that passes over time. Android supports PCM audio data in WAV files.WAV fileWav,mp3 etc is our more common audio format, different encoding format for the original
// Mmsystem play audio in WAV format// Mmsystem supports *. wav sound format snd-> soundrecorderUsesMmsystem; // reference mmsystem// Play the system sound{. Default // This is a string ('str ').MailbeepSystemexclamationSystemexitSystemhand}Playsound ('systemeg', 0, snd_async); // A pchar string// Play the sound in the list boxPlaysound (pchar (listbox1.items [li
. detailed structure of the Wave file:
// RIFF standard media stream File Header struct Riff_Header {Char szRiffId [4]; // 'R', 'I', 'F', 'F' DWORD dwRiffSize; // Size, except for the eight bytes, remaining file size, equal to the total number of bytes of the file-8 char szRiffFormat [4]; // 'w', 'A', 'V', 'E '}; struct Fmt_Block {char szFmtId [4]; // 'F', 'M', 't', ''dword dwFmtSize; // The Size is 16 or 18 WORD wFormatTag; // encoding method, generally 0x0001 WORD wChannels; // Number of
Because you only need to execute it on Windows, first think about using the MCI interface. After a try, mcisendcommand can be used to play the basic WAV file. However, loop playback of Wav is troublesome. The message mm_mcinotify must be sent to the window.
After Google, we found that there was a simpler method-UseSndplaysound. One statement, sndplaysound (filename, snd_async | snd_loop), can play
project.
Now we have a new empty project. In the tree directory on the left, find wave banks, which contains waves, which is the audio file. Right-click wave banks and select new wave bank. Then, right-click sound banks and select new sound bank to create a new sound bank. Sound bank contains sound, which are the objects actually played in the xNa project. A sound points to a wave, and some effects can be added to the wave.
Now there should be two
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.